package team.seekers.hula.course.resource.problemSubmit.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import team.seekers.hula.common.annotation.ApiResponseBody;
import team.seekers.hula.course.resource.problemSubmit.entity.dto.SubmissionDTO;
import team.seekers.hula.course.resource.problemSubmit.service.SubmissionService;
import java.util.List;

/**
 * date: 2022/5/3 11:59
 *
 * @author GH
 * QQ 1124813753
 */
@Controller
@RequestMapping("/submit")
@ApiResponseBody
public class SubmissionController{

    @Autowired
    private SubmissionService submissionService;

    @PostMapping("/saveOrUpdateBatch")
    public Void saveOrUpdateBatch(@RequestBody List<SubmissionDTO> submissions) {
        submissionService.saveOrUpdateBatch(submissions);
        return null;
    }
}
